import { Minimap } from '@antv/g6'
export const options = {
    container: 'main',
    width: 800,
    height: 600,
    fitView: true,
    fitCenter: true,
    fitViewPadding: [50, 10, 50, 10],
    layout: {
        direction: 'LR',
        type: 'xxx'
    },
    defaultNode: {
        size: 40,
        labelCfg: {
            style: {
                fontSize: 24
            }
        }
    },
    defaultEdge: {
        labelCfg: {
            autoRotate: true
        }
    },
    // 覆盖全局样式
    nodeStateStyles: {
        'nodeState:default': {
            opacity: 0.7
        },
        'nodeState:hover': {
            opacity: 1,
            fill: 'yellow'
        },
        'nodeState:selected': {
            opacity: 0.8,
            fill: 'white'
        }
    },
    // 默认边不同状态下的样式集合
    edgeStateStyles: {
        'edgeState:default': {
            stroke: '#aab7c3'
        },
        'edgeState:selected': {
            stroke: '#1890FF'
        },
        'edgeState:hover': {
            stroke: '#1890FF',
            animate: true
        }
    },
    modes: {
        default: ['drag-canvas', 'zoom-canvas', {
            type: 'drag-node',
            enableDelegate: true
        }] // 允许拖拽画布、放缩画布、拖拽节点
    },
    plugins: [Minimap] // 将 minimap 实例配置到图上
}
